Roadways are usually wide enough that a car can pass through the middle, leaving plenty of space for a cyclist on the right, and still avoid colliding with an oncoming car if that oncoming car moves to the right of its lane.
Of course, even though the above is possible, drivers often don't leave enough space for cyclists, so cyclists should ride in the middle to force cars to not try to squeeze past.