The equilibrium of the basketball makes it bounce lower every time. If it had perfect equilibrium, then it would bounce up to the same height every time. The kinetic energy is from when the ball hits the ground and is bouncing back up. But gravity will soon make it potential when it stays on the ground and when it stops rolling. When it rolls, the kinetic energy keeps it rolling until it gets so weak, there is only potential energy left to keep it stat