The knee is the largest joint in the body, and has the most propensity for injury. Because of the way it is built---a delicate balance of muscles, tendons, bones, and ligaments ---it endures tremendous stress during any activities that involve jumping, running, twisting or bending. Because of this, an injured knee can be more than just a nuisance, it can be a devastating injury.
The function of the knee is to provide a "fulcrum" in between the upper and lower leg bones that will make the legs stronger, more agile, and able to perform feats of strength and flexibility that would be impossible without the additional power that a bending joint can supply. The leg muscles are set up via a complex network of tendons and ligaments to attach over the kneecap, which provides the platform from which the muscles can then contract when the leg bends or twists---pulling or pushing the lower leg to match the movement of the upper leg. This allows us to perform movements such as running and jumping, as well as a host of other day-to-day activities that most of us do not even think about. Even in something as simple as walking, a fall can cause a severe injury to the knee if it is bent a certain way.
An injury to the knee can be devastating. If the ligaments or cartilage tear, it can cause permanent damage to the joint, and bone fractures as well as other bone injuries may require surgical treatment. In fact, most serious knee injuries will need to be repaired with surgery, as the joint is so difficult to heal that stabilization or physical therapy alone is almost never enough. Knowing when an injury is serious or minor is tricky at best, as people differ in pain tolerance levels, and a person can walk around on an injured knee, making it worse, for some time before it finally "gives out".
There are a host of injuries that can cause severe pain and swelling in the knee: dislocation, fracture, meniscus tear, ACL or PCL tear or rupture, muscle ruptures, ligament strains, and tendon tears are some of the main ones. One of the ways to figure out what type of injury you have is to identify what you were doing when it happened. Many ligament tears or ruptures are accompanied by an audible "pop" when the ligament goes. A dislocation is unmistakable, as the kneecap pops out of joint and the person experiences a huge shock of pain as the leg buckles beneath them. Fractures and meniscus tears are not as easy, and will require a medical test to diagnose. A simple guideline to follow is that if you experience severe pain and swelling, see a doctor.
In almost any case of severe pain or swelling of the knee, professional medical help is a necessity, not a choice. To delay treatment is to compound the injury. The longer you allow the joint to remain swollen, the harder it will be for a physician to get a correct diagnosis, as the fluid makes it hard for the doctor to get a good look or feel of the knee when he is examining it. In addition, getting off the knee is imperative. Do not hobble around on it. Do not try and brace it and walk. If you are truly in severe pain and have swelling, get to an emergency room or doctor immediately.
Depending on what the injury is, the treatment may or may not require surgery. In some cases, the knee can be drained of the excess fluid and bracing and physical therapy can address the issue. In many cases of severe injury, surgery will be necessary to correct the problem. Most surgeries can now be performed arthroscopically, with a minimum of risk or scarring. But in the worst injuries, open surgery may still be necessary to address the problem. Whatever needs to be done, take care of it as the knee joint is not something you can allow to "half-heal".