The mosquito you swat is only one part of the problem. Eggs, young mosquitoes (larvae), and pupae can overlap in summer. Grown mosquitoes can be there at the same time. That is why your yard keeps making mosquitoes. Things must change, or they will keep coming.
Think about the whole life cycle
Mosquitoes go through four stages. They are egg, larva, pupa, and grown mosquito. Warm weather can speed this up. So new grown mosquitoes may keep showing up. You may see fewer for a day or two first.
Why rain can restart the problem
A storm can refill containers that had gone dry. If those spots stay wet, a new group can grow there. Grown mosquitoes from the last group may still be there.
The useful takeaway
Do not focus only on killing the mosquitoes you see. Empty or fix the water that makes the next group. Check again after rain.
Quick answer
Does killing adult mosquitoes solve the problem?
It can cut down on mosquitoes out now. But it does not remove eggs in standing water. It does not remove young mosquitoes there either. Things get better for good when you deal with both. You must deal with grown mosquitoes. You must deal with places where they lay eggs.