STDs, like other diseases, can be either bacterial or viral. Examples of bacterial STDs include syphilis, gonorrhea, and chlamydia. Examples of viral STDs are HIV/AIDS, HPV, hepititus, and herpes.
For non-STD illnesses, the flu or the cold are examples of viral illnesses, while an infected cut on your finger is caused by bacteria.
Bacterial problems are usually brought under rapid control by simple antibiotic drugs. The bacteria causing the illness can be grown outside the body, using a culture medium. A doctor can take a swab of the puss, etc, from an infected area, have the lab grow a culture, and examine it under a microscope or by other tests to confirm the diagnosis. However, some bacterial illnesses can be identified by a blood antibody test, rather than taking a culture. Therefore, in the standard STD panel, a blood antibody test is used to check for syphillis, not a swab. Other bacterial STD often often have obvious signs (sores, discharge), and a swab is usually used to confirm the diagnosis made on the basis of these signs.
Viral conditions are more complex to deal with. Hence, there is no magic cure for the common cold. The virus can only reproduce inside living hosts, and can not be grown in a culture like bacteria. As such, confirmation of a viral diagnosis is usually based on antibody tests only.