For a starting point, assume the bike is balanced and moving forward. The center of gravity is over the tire contact patches. If it starts to tilt, the front wheel turns in the direction of the tilt, and the bike moves in that direction to place the tire contact patches under the center of gravity again. This happens by itself at speed, due to the geometry of the fork (why you can ride no-hands): and by the rider's hand movements at low speeds.