Many of these appendages are meant to solve problems that crop up during flight testing, although sometimes they appear in the design stage as a way to eke out extra performance in the form of low-speed handling, faster cruise speeds, or increased stability.
Leading-edge slots have been known to be an original design feature, although in most traditional general aviation airplanes they solve problems. Slots are lengthwise holes behind the leading edge of the wing that lower the stall speed. If you consider how a wing works, the principle is simple. As a wing moves closer to the critical angle of attack the airflow across the top begins to separate, usually starting from the back and moving forward. Slots act like a built-in jet of air that provides more energy across the top of the wing, allowing it to adhere at higher angles of attack. The reason we don’t find slots on every wing is because there’s a drag penalty. On short takeoff and landing airplanes, the primary goal of great runway performance is more important than the drag penalty, so you’re more likely to find them there.
The most famous example of slots on a standard GA airplane is probably the tail of the Cessna Cardinal. Soon after it was introduced, owners complained that the airplane was sensitive in pitch and that it was easy to both strike the tail and land hard on the nose. Engineers discovered the tail was stalling too early during landings, a symptom of having moved the leading edge of the wings back to improve visibility. A program began to retrofit the tails with slots installed upside down (the tail provides lift in a direction opposite the wings), which turned out to be successful and fixed the problem.
Slots are different from slats, which are essentially flaps on the front of the wing. Slats are moveable and change the chord of the wing, whereas slots are fixed and solve an issue with stalling at too low an angle of attack.