A substituant has priority over another if the atom by which it is attached has a larger atomic number.
In the case where two substituents have the same atomic number, one considers their own substituents and then ranks them in decreasing order of priority by comparing them as integers ( for instance 311 >299 because 3>2 )
Here C has priority over C since the substituent atoms of these two C atoms ranked in decreasing order of priority give: Cl,H,H > H,H,H (like 411>111)
Two isomers Z ou E appear, if each C-bearing atom bearing a double bond has two different substituents. The isomer Z or cis has the priority substituents on the same side of the axis consisting of the double bond. The isomer E or trans has the priority substituents on either side of the axis constituted by the double bond.
In the latter case, the aldehyde function has priority, because the double bond C = O is counted as two simple, thus aldehyde (O,O,H) > alcohol (O,H,H)
Two isomers cis or trans appear, if two C atoms of a cycle have two different substituents. The isomer cis has the priority substituents on the same face (top or bottom) of the cycle. The isomer trans has the priority substituents on two different faces (one at the top, one at the bottom) of the cycle.