I read that knights were beholden to their overlord only for 40 days a year, isn't that extremely insufficient for any military campaign?
Kind of - but the 40-day obligation of service is not the entirety of the picture. More can be said if anyone would like to chime in - especially from other areas and times of the Medieval Period - but these two answers by u/Goiyon should go some way to answering your question. This post answers the 40-day period specifically, and here's also another one on the raising of an army, which also deals with the 40 days.