When traveling by commercial, low-cost airplane flights to a location, they frequently make a "stop in the middle" for some reason, forcing all the passengers to exit the plane, wait around at or near the airport, and then board another plane, possibly many hours of waiting in between
Flights don't just stop "for some reason" as if it's some kind of mystery. Time the plane is on the ground is time it's not carrying passengers, and therefore not making the airline any money. There are always specific reasons to stop. Sometimes particularly long routes will have stops for fuel, and there are even some flights which serve multiple destinations in much the same way as a bus or train, but those stops are generally rather short. Far more often, the reason is that you're talking about several different flights. For example, Swiss don't fly from Hamburg to Barcelona, but they do fly from Hamburg to Zurich and from Zurich to Barcelona. So if you're in Hamburg and you want to go to Barcelona, they'll be perfectly happy to sell you a ticket from Hamburg to Barcelona via Zurich. Passengers might choose that option because it's cheaper, or at a more convenient time, than flying direct (or, with other destinations, because there are no direct flights available).
During this time, as I understand it, the passengers/travelers are allowed to freely exit the airport and go around town in whatever city in whatever country they are "middle-stopping" at, as long as they come back in time for the next departure?
Yes, as long as you comply with the standard immigration requirements (depending on nationality you might need a visa, for example).
Isn't this a bit strange security-wise, considering the rigorous security (or perceived security) measures they have when you actually board a plane or (I thought) exit the airport to enter the country/city?
When you leave, you go through the same immigration procedures as the people who have that airport as their final destination. When you return to the airport you go through exactly the same security as all the people who are preparing to board their first flight. At many airports that means that while you are allowed to leave between flights, there's no point unless you have at least 4-5 hours (or even more in some cases) between flights.
But how is this possible? I thought airports and harbors these days had tons of "security theatre" nonsense, with tons of "red tape", making it an absolute pain to deal with, and something to avoid at any cost? Or is this somehow ignored for cruise ship people? They just show their wrist band and the people go: "Sure! Enjoy your few hours here!"?
See this link posted by @Traveller in the comments for an example of how immigration requirements are handled on cruises. The details will vary between operators and destinations, but it's broadly the same thing: passengers have to supply the cruise operator with details of their passport and other required documentation. The cruise operator makes those details available to immigration at the cruise's destinations. The passenger's documents are checked when they first arrive at the departure terminal to make sure they have the documents they claim. If you don't have the documents required to enter the cruise destinations, you won't be allowed on board.
At the destinations, people don't typically need to pass immigration, as checks are performed remotely based on the documents which were already collected. On returning to the ship, each operator will use different techniques but there's an ID check of some sort to ensure that you are indeed one of the ship's passengers.
And the same goes for airports when they "stop-in-between"? If so, why is security vastly different for people who (maybe) will only stay there for a few hours?
As I said earlier, you face the same security procedures on your way in and out of the airport as all the people who are just taking one flight.
Can't they also hurry up and commit all kinds of crimes in those hours? I don't get it.
Can't you just commit all kinds of crimes in the few hours before taking your first flight of the day? I don't get what you think stopovers have to do with this.
Something about this doesn't add up to me. It seems like you can "trick" or "bypass" your way into visiting all kinds of places just by taking a cruise or flying cheaply (the flights that stop on the way seem vastly less expensive money-wise), but something tells me that they must have thought of something which I haven't.
Buying tickets to places is not "tricking" your way into visiting them. Visiting multiple places is literally the entire point of a cruise (ok, sure, it's not the entire point - but it's generally a major selling point and the primary purpose for many passengers). With flights, stopovers are often just an irritation that you put up with because it saves money or avoids having to waking up at 3am. But yes, occasionally it can be a nice bonus to have a few hours to explore somewhere.