The symptom of a knee giving out is most often due to a ligament injury. The knee is held together by ligaments, structures that connect two bones. There are four major and many secondary ones. The sensation of instability—the feeling of your knee giving out—is often due to an injury to at least one of them, which leads to the bones not being held tightly enough in position.
Source: Verywell Health