A Punnett square is a grid that shows every possible way the alleles from two parents can combine. Each parent makes gametes, and each gamete carries just one allele of the gene. Write one parent's gametes across the top, the other parent's down the side, then fill each box with the two alleles that meet.
Take two heterozygous tall pea plants (Tt x Tt). Each parent makes T gametes and t gametes. The four boxes give TT, Tt, Tt and tt. Three of the four boxes contain a T, so the offspring are tall and short in the ratio 3:1. The probability of a short offspring is 1 in 4, which is 25%, and the probability of a tall one is 75%.
Now cross a heterozygous plant with a short plant (Tt x tt). The boxes give Tt, Tt, tt and tt. Half the offspring are tall and half are short, a ratio of 1:1, or 50% each.
These are probabilities, not guarantees. Like tossing a coin, a family of four offspring may not match the predicted ratio exactly. The ratio is only reliable when there are many offspring.