Samskara is a sanksrit word. It refers to a deep mark left in the subconscious mind after a good or bad thing happens.
It may reappear later in life (or in later lives) in the conscious mind with a charge of feeling which may cause the person to become involved with it or follow an action motivated by it.
If one responds to the samskara (or subconscious complex) or even just keeps thinking about it, it increases in power.
The group of samskaras of each person defines their personality, and if fed, can cause massive changes in words, thoughts, actions, character and habit.
The only way to remove the samskara is to completely ignore it. Each time it rises and gets no response, it loses its power to motivate and compel. Eventually it fades away.
Samskaras can be passed to others if living or interacting closely and/or for a long period of time. For example, parents can pass their prejudices and obsessions on to their children.
Because it is the samskaras which define our personality and our ego, essentially this ego (sense of 'I') is an illusion - this petty mind is an illusion.
If the samskaras are treated correctly and broken down, the ego disappears and the true, eternal and unchanging self is realised.