Most Koopas seem to operate in a hierarchy-based grouping system. Bowser is the leader of the Koopa Troop, which has invaded Mushroom Kingdom many times and has control over most of the Koopas in the Mario series. Many of these same Koopas are soldiers in this army and have different tasks in the organization based on the abilities of their particular class. For example, Koopa Troopas tend to be assigned as basic foot soldiers alongside Goombas due to their lack of special abilities, while Magikoopas are often given advisory roles due to their magical abilities and gift of foresight.
However, not all Koopas are allied with Bowser. Some Koopas, such as the Koopa Troopas of Koopa Village, live peacefully inside the borders of the Mushroom Kingdom, while others in Super Mario 64, simply hold no allegiance and operate independently.
Similar to turtles, Koopas possess shells that are usually a defense mechanism. Unlike turtles, however, the shells are not integrated into their body and more-or-less act as wearable armor/clothing, as evidenced by Super Mario World and Paper Mario.