! Here be spoilers !
The second character, referred to as the Guardian and the Dream Visitor, is an NPC that protects your main character(s) from ceremorphosis, the process initiated by infection with an illithid tadpole.
The Guardian will initially visit your main character in their dreams, and tell you of the protection they offer them.
This Guardian is in actuality a disguise used by the mind flayer known as the Emperor. The Emperor can be found in a pocket plane on the Astral Plane reachable only by means of the Astral Prism, the 'Mysterious Artefact' Shadowheart is so keen to bring to Baldur's Gate.
This mind flayer initially can only communicate telepathically, hence their introduction in a dream.
Their relationship towards you is still more complicated than this, and unfolds while you play the game.
Why you are able to create this non-playable character in the first place, is a very clever way to allow for the disguise to have a specific meaning to the player, a manifestation of the protagonist's concept of a Guardian.