The UK treats GIB as an international destination, it's not a "domestic" flight. Spain requires API from incoming flights, a flight to Gibraltar would not submit API to Spain, but of course weather-related diversions to AGP are nothing new.
When ETIAS comes in, assuming the UK isn't going to relent and accept a third party making decisions on British citizens being able to enter a British territory (as there is a plan that Gibraltar could join Schengen), then you would need one to enter Spain but not to enter Gibraltar.
I don't know if Gibraltar is going to be part of the UK ETA or have its own at some point... but when that comes in, non-British and non-Irish without UK residency would need a UK ETA to fly from GIB to the UK.
There is talk of UK trying to negotiate getting out of ETIAS. I actually think it's pretty likely if they're willing to exempt EU citizens from the UK ETA.