They measure exhaust fumes with a special nozzle that fits over your exhaust pipe(s) while your vehicle is idling and I think with a dynometer(it's been a while for me) and there is a maximum output of various gases. If your vehicle is over the limit, it must be fixed to be below the maximum before one is eligible for a passing certificate which is sent electronically to the Department of Motor Vehicles.
I haven't lived in Texas in 20+ years but I remember the annual sticker visits at gas stations, they would check that the head lights worked and were pointed at the correct direction for the height of the lamp, that your windshield wasn't cracked in your field of view, the using the brakes turned on the brake lights, and other things, if your vehicle failed any of the checks you were required to fix them and get re-inspected and pass the entire suite of tests before one got the inspection sticker.
I was not aware that Texas was that way.