The patella and the tissues that hold it place (MPFL ligament, depth of groove, height of the patella) with its exposed location can dislocate out of position almost always after an injury during sports or by itself when dancing, running etc as the tissues that hold it in place are not strong enough to keep it in position.
Usually after one dislocation treated with splinting in a brace or plaster the patellar soft tissues heal and it stays in place generally. If however the patella dislocates again or partially comes out of place, either due to high location, shallow groove or torn MPFL (medial patello femoral ligament) then it might require investigation and possibly surgical repair.
X-rays, CT or MRI scans may be necessary to identify the factors causing the repeated dislocations (recurrent). Surgical repair of the causative factors including reconstruction of the MPFL ligament may be necessary.