Reaction of cyclohexene with hydrochloric acid
Have a look at the mechanism for the dimerization of cyclohexene in strongly acidic medium:



After the attack of a nucleophile (pi bond) on the electrophilic carbocation, we have:

A: joining of the two rings with a bond, and the consequent carbocation (why did it get formed on that position? why not on the adjacent ones?)
B: rearrangement of the carbocation (why did it happen?)
C: loss of a proton to form the thermodynamically most favorable product (most substituted alkene)  

The double bond was formed because of the loss of the $\ce{H+}$ ion in step C, formation of a negative charge at that position, and then the delocalisation of that negative charge into the adjacent empty p-orbital (of the $\ce{C+}$ position).