Let's investigate how the flaps and slats work by using a Java simulator. You can deploy the flaps and slats by using the slider at the bottom. The next time you fly in an airliner, watch the wings during takeoff and landing. On takeoff, we want high lift and low drag, so the flaps will be set downward at a moderate setting. During landing we want high lift and high drag, so the flaps and slats will be fully deployed.
Spoilers create additional drag to slow down the plane.