Adding to Ulumuri's excellent writeup, a few more items seem to be in order:

-The tires matter.
Iffen there every were an important part of a wheeled vehicle, the tire would be it. As Phish sings, "The tires are the part of your car that make contact with the road." Racing treads make riding sans hands far easier. A racing bike, even with its thin contact patch, is more stable than a mountain bike with its asymmetrical knobby bits. A street bike is ideal, with its smooth, wide tires.

-You're riding a gyroscope.
The reason why you are more stable at high speeds is that you have higher rotational momentum in your wheels at high speeds. Just as linear momentum makes it harder to change course, rotational momentum makes it harder to tilt the bike: to fall over, the bike must rotate on the axis parallel to your path. Rotational momentum is dependant on moment of intertia (sort of like the mass of an object when dealing with linear momentum) and rotational velocity (sort of like velocity when dealing with linear momentum). You can increase the rotational velocity by making the wheels spin faster. This involves either large cliffs and furious pedalling or simply riding faster. Ideally, for stability you would ride a bike with wheels simply consisting of large lead disks. This would also give you amazing quadracep.

While fairly easy, never try this on a motorcycle.
Mind you, I'm a wussy, but it really isn't smart. It's easy to be enchanted by a brand-new throttle lock, but one needs to be able to steer, use the front brake, and clutch to operate a motorcyle safely. You would be stable, though. Historical examples of unintentional empirical testing have revealed that the immense rotational momentum of motorcycle wheels at reasonable highway speed can keep a bike up for at least a mile after the rider's unexpected departure.