It can take some time for the on-vs-off signal to propagate through a multiple transistor circuits inside a logic gate, because it takes some time for transistors to ``turn on'' or off when the ``control'' voltage or current at the gate or base changes. Stray capacitance matters, since it can require some charging up or charging down time to reach an appropriate voltage to turn on or off a transistor.