Airline security regulations are intended to keep passengers and property safe. Passengers are not allowed to annoy each other or interfere with flight crews. The pilot is authorized to arrest rule violators and even handcuff them if they get too unruly. An aircraft in flight is like a ship at sea, and the captain has the same level of authority in both cases.
A passenger who becomes drunk and obnoxious, or who smokes in a non-smoking flight, is subject to arrest.
Some airlines use plainclothes armed marshals, notably Israel's El Al. The U.S. tried a marshal program, but their dress code made the marshals conspicuous and thus ineffective as undercover agents.