The tendency of the steering wheel to return to the straight-on position is caused by the caster action of the front wheels.
This effect is more clearly seen on a shopping trolley where the vertical swivel axis of each wheel is in front of the wheel-to-ground contact point.
If you start pushing the trolley when the wheels are not aligned to the direction of the trolley motion, the wheels are pulled around into alignment by the drag force between ground and wheel.
The full explanation is that as the trolley moves forward, the drag force exerted by the ground on the wheel always opposes any relative motion, or slip, between the wheel and the ground.
Unless the wheels are aligned to the trolley motion, the drag force does not pass through the swivel axis, and therefore it produces a turning moment about that axis which always acts to bring the wheel back into alignment.
In a car, the same effect is achieved by inclining the steering axis and ensuring that the point where the axis intersects the ground is ahead of the tyre-ground contact point.
The same is true of a bicycle, as you can see if you hold a broom handle alongside the steering axis of the bike so that the handle touches the ground. You should see that this point is just in front of the tyre-ground contact point.
You can demonstrate the caster action on a bicycle for yourself by pushing the bike backwards and forwards by the saddle while the handlebars are left free.
When going forwards, the bike is easy to push in a relatively straight line.
However, going backwards is almost impossible because the front wheel tries to turn round through 180 degrees just as would a shopping trolley wheel.
You will also find when reversing a car that the steering wheel loses its tendency to centre itself.