This reaction is known as dehydration reaction.
Dehydration of alcohol is used to form alkene. It can also be said one type of elimination reaction.
In dehydration reaction initially proton attacks on lone pair of hydroxy group to form hydronium ion which later removes and leaves carbocation. If formed carbocation is not stable then it makes some rearrangement for stability. After getting stability it attacks on alkene to show electrophilic addition reaction then beta hydrogen leaves its electron to give stability to the carbocation and takes its positive charge with itself.
The reaction of the given question is shown below: