Frost forms if there is some water vapor in the air and if the temperature of an object is below or at the freezing point of 32°F. Objects can include grass, or windshields.
If the sky is clear at night, and we have light winds, frost can form easier. Objects emit radiation, and as this happens the object cools, forming frost.
Objects can be cooler than the air temperature, which is why frost can still form even if the air temperature is above 32°F.