LDO output and input capacitor clarification
The regulator you linked to is not LDO. LDO regulator have even more strict requirements for the output capacitor, it needs specific capacitance range and ESR range for stability.

But for a normal linear regulator, if you have long wires from regulator input to the power source, you have inductance. When the regulator needs to provide a surge current to load it requires surge current from the input and it can't get the current. So the input capacitor is a local bypass capacitor for stabilizing the voltage and allows current pulses to be drawn. Without input capacitor the regulator can turn into an oscillator. As the datasheet says, input capacitor may not be needed if the input bulk capacitor is close, but it also mentions it might be needed if the output capacitance is large.

Sometimes the output capacitor is needed also for stability. The datasheet says it is not required for stability, but it improves output impedance during transients. For example, USB is a hot-pluggable interface with 5V power supply. It requires that a device has a maximum capacitance of 10uF at the input. Surely the regulator output would jump momentarily to zero if you connect an empty 10uF cap. That's why USB hosts need to have enough capacitance at the output, in the order of 200uF, to prevent the voltage dropping too much for other devices.