This argument (the ontological argument) comes from St Anselm of Canterbury, who lived from 1033 to 1109. He said that the existence of God can be deduced from just the idea of God. Just because we can think about God proves that God exists. It goes like this:
- By definition, God is that being greater than which none can be conceived.
- God can be conceived of as just a thought in your head, or as really existing.
- It is greater to exist than not to exist.
- Therefore, God must exist.
A monk whose name was Gaunilo replied to this by saying that you could use this to prove anything at all. For example, you could have the idea of a perfect pizza, "greater than which none can be conceived". Therefore such a pizza must exist, because if it did not it would be less great. As this is ridiculous, it shows that you cannot infer that something exists from the IDEA of its being perfect.
St Anselm replied that the ontological argument does not work for pizza (or anything else); it only works for God, as the relationship between God and perfection is a unique one.
Anselm distinguished here between "accidental" properties and "essential" properties. A pizza might or might not have the property of being the greatest conceivable pizza. It's an accidental property, not an essential one. But if God exists, then God must be by definition the greatest conceivable being. It is an essential property of God. But to actually BE the greatest conceivable being, God must exist.