When a new versionable node is created, a new version history is created for it. At first, the version history consists of only the nt:versionHistory node and its single child, the nt:version node representing the root version, which will serve as the starting point, from which the version graph of successors will proceed. The root version does not store any state information; it serves only to make the semantics of subsequent operations consistent. Initially, the root version also serves as the base version for the new versionable node.
In terms of actual nodes and properties being created or changed, here is what happens when a new mix:versionable node N is created in workspace W1:
N is created by the call M.addNode("N") where M is some suitable parent node for N.
Before being saved, N is made versionable by the call N.addMixin("mix:versionable"). In some implementations, dynamic assignments of mixins may be supported, thus allowing a node to be rendered versionable at any time in its lifecycle, not just upon creation. See 7.4.3 Assigning Mixin Node Types.
On save of N, a new version history is automatically created for N. This means that the repository automatically creates a new node of type nt:versionHistory (call it VH). VH automatically gets a child node of type nt:version called jcr:rootVersion (call it V0).
V0 is the root version of VH. This root version does not contain any state information about N other than the node type and UUID information in the jcr:frozenPrimaryType, jcr:frozenMixinTypes, and jcr:frozenUuid. It is a dummy version.
The REFERENCE property jcr:versionHistory of N is initialized to the UUID of VH. This constitutes a reference from N to its version history.
The REFERENCE property jcr:baseVersion of N is initialized to the UUID of V0. This constitutes a reference from N to its current base version.
The multi-value REFERENCE property jcr:predecessors of N is initialized to contain a single UUID, that of V0 (the same as jcr:baseVersion).
The BOOLEAN property jcr:isCheckedOut is set to true.