Contributors to OpenStreetMap walk, cycle or drive around an area, recording their position at regular intervals using a GPS receiver. This creates a set of breadcrumb trails that show the position of streets.
Once GPS data has been gathered, it can be traced using JOSM, the offline editor for OpenStreetMap. "Nodes" and "segments" define the physical layout of roads, rivers and other features.
Street names, routing information and other data is overlaid on the physical layout using "ways". Each segment can belong to more than one way, so that the topology can be reused as much as possible.
Once the topology is defined and tags added to define street types and other features, it can be rendered into a map.