There are a number of reasons why:
The dome is not the proper fit for your ear canal
Talk to your hearing professional about trying a different size or style. It is not uncommon to have a different dome on each ear, based on your ear canal size and your hearing loss.
You are not inserting them far enough into your ear canal
The wire should be snug against the side of your face. If this insertion causes discomfort, you should see your hearing professional about changing the length of the wire.
The hearing aids retention cord is not properly sitting in your ear (bowl) concha
In the first picture the retention tail can be seen neatly tucked under and back in the ear concha. With the wire snug along the side of the face.
The second picture shows a loose improper fit. The hearing aid and tail need to be inserted deeper into the ear canal.