The major difference between atomic force microscopy and competing technologies such as optical microscopy and electron microscopy is that AFM does not use lenses or beam irradiation.  Therefore, it does not suffer from a limitation in spatial resolution due to diffraction and aberration, and preparing a space for guiding the beam (by creating a vacuum) and staining the sample are not necessary.
There are several types of scanning microscopy including scanning probe microscopy (which includes AFM, scanning tunneling microscopy (STM) and near-field scanning optical microscope (SNOM/NSOM), STED microscopy (STED), and scanning electron microscopy and electrochemical AFM, EC-AFM). Although SNOM and STED use visible, infrared or even terahertz light to illuminate the sample, their resolution is not constrained by the diffraction limit.