Why A flip-flop is a bistable element that changes state only on a clock edge. Wire it to toggle (a JK with J=K=1, or a D flip-flop with Q-not fed back to D) and the output flips once per input pulse, so it takes two input pulses to complete one full output cycle. That halves the frequency, which is why chains of flip-flops make binary counters and divide-by-2^n dividers.
Watch out XOR and OR gates are combinational: their outputs depend only on the present inputs, with no memory of past pulses, so they cannot count or divide. A multiplexer just selects one of several inputs to pass through.
Only memory divides. Flip-flop toggles once per clock, so out = in / 2; N flip-flops give divide by 2^N.