There are many causes of headache. However I will be specific in my answer so that I address the headache you have described.

Headache can be caused by poor posture in the following way.

Poor posture results in the creation of tension in your upper back, neck and shoulders, which can lead to a headache. As would be the case after sitting in certain position looking at your phone or tablet for hours.

Classically, the pain throbs in the base of the skull and sometimes flashes into the face, especially the forehead.