Why do aircraft sometimes bounce while landing?
The FAA covers this in the airplane flying manual quite nicely:

Bouncing During Touchdown
When the airplane contacts the ground with a sharp impact as the result of an improper attitude or an excessive rate of sink, it tends to bounce back into the air. Though the airplane’s tires and shock struts provide some springing action, the airplane does not bounce like a rubber ball. Instead, it rebounds into the air because the wing’s AOA was abruptly increased, producing a sudden addition of lift...

There is some more info in the doc worth reading as well.
In the simplest terms this can be one of the outcomes of an unstable approach; oftentimes, when the approach speed is too high, bouncing will result. Touching down on the nosewheel first can also cause a very dangerous bounce case known as a porpoise.
In some cases wind shear can cause bouncing. In this case the shear may cause an unexpected downdraft, forcing the plane down onto the runway vertically and inducing a bounce, or it may cause an updraft leading to an overcorrection by the pilot to descend; when the updraft stops, the plane falls rapidly.