A tennis ball is essentially a pressurized rubber ball covered with cloth. The rubber is not completely impermeable, however, and slowly leaks over time, just like a latex balloon eventually loses its air.
In a game, when the ball hits the court surface, the outside of the ball caves towards the center to make an indent on the side. That force pushes the air inside in the opposite direction (towards the other side). The outward force of the indent pushes the ball away from the court surface, which means the ball bounces up. More and more air keeps on getting out over time until there is not enough pressure inside a ball to help bounce it back up.
Also, the rubber loses some of its elasticity, although that effect is probably negligible, inasmuch as even unused tennis balls that have been removed from their pressure pack become “dead.”