These lifeforms entered the cerebral cortex of a person who was at their most vulnerable, in a state near death, and blocked attempts of resuscitation. The alien entity needed the person to enter their matrix voluntarily, so they caused hallucinations of loved ones for the victim in an attempt to convince them to enter the matrix, claiming it to be the afterlife, a "place of wonder" that could assume any desired form for them.
In 2373, one of these aliens attempted to entice Captain Kathryn Janeway into the matrix, posing as her deceased father. She saw through it's ruse and refused to enter. The alien dislodged from Janeway's brain.