As I understand it, it's a combination of things: aircraft reports, atmospheric motion vectors (e.g. a cloud doesn't have any propulsion, so if a cloud moves 30 km in an hour, you have learned something about the wind), Doppler wind lidar, and satellite measurements.
The numerical predictions of weather models often have many vertical components as well, so solving it for ground level also requires extending the forecast to the air, depending on the model.