How are Zwift roads made, both imaginary and GPS replicas?

Hi, I don’t want this to be a cynical question, just one of pure curiosity. With Zwift roads and routes constantly on my mind, I am curious how one makes a road that is translated, both to my smart trainer as distance and gradients and GPS data (like for Strava), into something ridable, almost as though it were a road I was physically riding on?
Of course we can just take GPX files recorded by bike computers and mess with them, but what does it take to make that a Zwift road, with gradients, distances, visuals at certain points, etc.? How does it work?

Only workout, no visuals.

Appreciated, but I mean how does Zwift do it, not how can I do it.

This may be of interest, several years old now. Ep 47- Zwiftcast Special: How The Alpe du Zwift Was Made - YouTube


Very helpful, thanks!