Suppose the given proposition:
- (1) There is a possible world which there is an entity which possesses maximal greatness.
- (Hence) There is an entity which possesses maximal greatness. 
How do we move from mere possibility to actual (real) existence? The argument builds the concept of necessity into the meaning of “maximal greatness,” which, as defined as Alvin Plantinga: “An entity possesses ‘maximal greatness’ if and only if [ … ] it is necessarily existent and necessarily maximally excellent” .
Thus, let G stand for the proposition that
- G: An entity exists that is maximally excellent.
However, this entity is not maximally great. To say that there is a maximally great entity is to say that it is necessary that G is true. In the formal notation of modal logic, □G. Thus, the first premise is saying that it is possible that it is necessary that G is true. In formal notation this proposition is expressed as ◊□G. The conclusion thence follows to □G.
In the S5 version of modal logic, the conclusion does follow – where every possible world is accessible from every other. To note from Poythress:
As usual, universal accessibility means that every possible world that is accessible at all, or from which our world is accessible, is accessible directly. But the postulate of S5 cannot exclude a model where there are other universes of worlds, all of which are inaccessible to our local group of possible worlds and from which there is no access to our local group. 
Poythress goes on to explain the premise-to-conclusion dilemma that we seem to have:
Here is the reasoning that establishes the conclusion □G. Assume the premise, namely, ◊□G. Let the initial world be E. By definition of the symbol ◊ in the model, there exists a possible world W in which □G. By definition the symbol □, G is true in all possible words (in the subset of mutually accessible worlds). Therefore, back in E, G is true. Moreover, G is true in all the other worlds accessible from E. Hence □G in E. 
-  Cited in Graham Oppy, “Ontological Arguments,” Stanford Encyclopedia of Philosophy (Fall 2011 Edition), ed. Edward N. Zalta, http://plato.stanford.edu/archives/fall2011/entries/ontological-arguments/, accessed August 24, 2012.
-  Ibid.
-  Vern Poythress, Logic: A God-Centered Approach to the Foundation of Western Thought (Crossway: 2013) p. 665 – see note 3.
-  Ibid.