Every nucleotide has a 3′ end with a free OH group and a 5′ end with a free phosphate. Linking them together requires forming a bond between the 3’OH of one base and the 5’P of the other. In solution either base could attach to either end of the other, but in a growing DNA (or RNA) chain the enzyme that is used only can add a base to a 3’OH group, not to a 5’P. In theory it should be possible to have an enzyme that worked the other way, but it just doesn’t happen.
The upshot is that in replicating DNA the two strands have to be treated differently. One can be synthesised continuously in a 5–>3 fashion, but the other has to be made in short segments (Okazaki fragments) which get linked to form the other strand.