In a series of recent papers, it has been proposed that high field magnetic white dwarfs are the result of close binary interaction and merging. Population synthesis calculations have shown that the origin of isolated highly magnetic white dwarfs is consistent with the stellar merging hypothesis. In this picture, the observed fields are caused by an alpha-Omega dynamo driven by differential rotation. The strongest fields arise when the differential rotation equals the critical break-up velocity and result from the merging of two stars (one of which has a degenerate core) during common envelope evolution or from the merging of two white dwarfs. We now synthesise a population of binary systems to investigate the hypothesis that the magnetic fields in the magnetic cataclysmic variables also originate during stellar interaction in the common envelope phase. Those systems that emerge from common envelope more tightly bound form the cataclysmic variables with the strongest magnetic fields. We vary the common envelope efficiency parameter and compare the results of our population syntheses with observations of magnetic cataclysmic variables. We find that common envelope interaction can explain the observed characteristics of these magnetic systems if the envelope ejection efficiency is low.