Keeping the water from freezing
A tennis ball in a birdbath sounds odd, but it’s a common winter trick, and most people use it to keep water from freezing. The main reason is winter. A floating ball drifts and moves when the wind blows, and that motion can slow ice from forming. If a thin skin of ice does form, the ball can break it up.
Why not use antifreeze
Antifreeze and chemical de-icers are not safe for birds that drink from the bath. A floating object is a simpler and safer choice, and it costs very little.
Helping insects climb out
Bees, wasps and other insects can fall in and drown. A tennis ball’s fuzzy surface may give them something to grip as they climb out. This is a common suggestion, but there’s little formal testing of it, so treat it as a helpful extra rather than a proven fix. Stones or a stick leaning against the rim can serve the same purpose. If bees are also a problem at your nectar, you may be asking how to feed hummingbirds without attracting bees, which is a separate question.
Other floating options
A ping-pong ball or a cork works in much the same way. Pick something light enough to float and not likely to break into small pieces. Check the ball now and then, and replace it when it gets grimy or waterlogged.
What it won’t do
A tennis ball won’t break through thick ice, and it won’t keep water open in very cold weather on its own. Clear any ice that has already formed before you add it. In harsh winters, a heated birdbath is the more reliable option.
Hummingbirds and winter
Many hummingbirds have migrated south by winter, though some species stay in parts of the West. The ball is for keeping water available to birds that stay, and it doesn’t draw hummingbirds. If you’re deciding when to take feeders down, hummingbird feeder season covers the timing.