One pair of chromosomes are known as the sex chromosomes and these determine the sex of the hamster.
The female has two identical chromosomes X and therefore the female is XX. However, in a male the sex chromosomes are different with one being X and one being Y ie XY (Y being the male part of the chromosome).
During reduction division the female will pass half of the number of chromosomes (including the sex chromosome) to the egg and the egg will therefore contain one X chromosome. The male on the other hand will pass half of the number of chromosomes to the sperm but could equally pass the X or Y sex chromosome. When the X chromosome in the egg is fertilised by a sperm containing an X chromosome from the male it produces a female cell XX but when the egg X is fertilised by a sperm containing a Y chromosome from the male it produces a male cell XY.