Both types of herpes are transmitted through contact with skin or mucous membranes and are particularly contagious just before, during and for a while after an outbreak. The wounds coming can come and go at irregular intervals. Outbreaks can occur both for no particular reason and as a result of, for example, sunburn, stress, alcohol intake or other things that affect the skin/lips' resistance and the body's immune system.
You get the first outbreak after the virus' genetic material has entered your own genome. After this, when your immune system is weakened due to stress, exhaustion or an infection, the virus gets the opportunity to divide quickly from your cells. Cold sores, such as colds, are often seen in children because their immune system has still not come this far in adapting to all the viruses we have around us. It happens less often later in life as the immune system gradually becomes better equipped to stop infections.