Roof racks can be attached in a number of different ways, including:
Pre-existing holes in the roof specifically designed for a roof rack
A raised rail that’s on the roof specifically for attaching a roof rack
There’s a flushed rail designed for a roof rack
The vehicle’s rain gutters (least common)