Modern cars are designed to deform in a controlled way and then to hold specific dimensions everywhere else. Whether they still do cannot be judged by looking, which is why measurement exists.
What is being measured
Reference points defined by the manufacturer: suspension mounting positions, subframe locations, body datum points, and the relationships between them in three dimensions. The specification gives a target and a tolerance, often only a few millimetres.
How it is done
Either by mechanical gauges bridging known points, or by an electronic system that uses targets and sensors to compare the car against a manufacturer dataset and produce a printed report. The electronic systems are faster and produce documentation, which matters when the result has to be shown to an insurer or a future buyer.
Why eyeballing fails
Panel gaps can look even while the structure underneath is out, because panels bolt on and can be adjusted to hide a problem. Conversely a car with uneven gaps may be structurally fine. The two are not reliably related, which is exactly why measurement is not optional after a significant impact.
Pulling
Where the structure is out of tolerance, the vehicle is anchored to a bench and pulled in the opposite direction to the impact, measuring continuously. Metal has memory and springs back, so it is pulled slightly beyond target and allowed to settle. Some components are designed not to be straightened at all and must be replaced.
What this means for you
Ask for the before and after measurement report. It is the evidence that the car is within specification, it belongs in your repair file, and it is worth having when you sell. A car repaired without measurement after a structural hit has not been verified, whatever it looks like.
Why alignment comes afterwards
Wheel alignment adjusts suspension settings. If the points those settings are measured from have moved, aligning the wheels cannot correct it. Structure first, then alignment.