Frogs have a three-chambered heart when there is are two types of blood mixing; a three-chambered heart prevents this from happening. The two types of blood are deoxygenised and oxygenated.
Frog hearts contain two atria and one ventricle. When the single ventricle contracts, oxygenated blood is sent into the carotid arteries, carrying blood to the head and brain. Deoxygenized blood is sent to the pulmocutaneous arteries, taking blood to the skin and the lungs. The three-chambered heart works fine for frogs with small bodies. In order for any type of frog to develop a four-chambered heart, it needs to evolve further.