IMHO based on trying to teach my kids to ride it is partially the rotational interia of the wheels but mainly the brain. The brain senses the movement of the bike and the small resistance of the rotational inertia and is able to correct it via the handlebars. This takes time to learn. When the bike is not moving there is no rotational inertia and nothing to sense or push against.
Latest Answers