The middlegame (in chess terms) is the stage of the game after the opening. There isn't a clear line between the opening and the middlegame, or the middlegame to the endgame as some openings blend from the opening to the middlegame, especially in sharp (highly tactical) openings, although the middlegame usually starts after the development of both sides have been completed and both kings are safe.
After the first moves in the Najdorf Sicilian (1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6):
White can choose to go in the sharp main line with 6.Bg5 after which black can play in a lot of different ways e.g. After 6...e6 7.f4 black can play 7...Qb6 attacking the pawn on b2. After 7...Qb6 the main line for white is 8.Qd2 sacrificing the b2-pawn (Poised pawn variation)
, after which play could continue Qxb2 9.Rb1 Qa3 10.f5 Nc6 11.fxe6 fxe6 12.Nxc6 bxc6 13.e5 dxe5 14.Bxf6 gxf6
15.Ne4 Be7 16.Be2 h5 17.Rb3 Qa4 18.Nxf6+ Bxf6 19.c4 etc. As you can see, the following moves are very complicated and are analysed way out of the opening stage.