Wave petunias going to seed

Why do wave petunias start to seed part way through the summer? They looked good for June and most of July, then the flowers became sparse and started to produce seeds. I have them planted in planters in front of…