Paul Gallacher marked his 50th Football League start with a superb 30-yard strike to give Leicester the lead after 15 minutes at the Walkers Stadium.
Wales international midfielder King made it 2-0 two minutes before half-time but Jacob Mellis scored in first-half injury time to give Barnsley hope going into the break.
King restored the two-goal cushion just before the hour mark before Kyle Naughton completed the scoring with another long-range cracker in the final minute.
It secured a fifth win in six league matches for Sven-Goran Eriksson’s side, who are up to eighth in the table and three points shy of the play-off positions.
After a quiet start to the game, Gallacher brought the Walkers Stadium to its feet with a magnificent right-foot shot into the top corner from Richie Wellens’ pass.
Wellens was involved again when King doubled Leicester’s lead in the 43rd minute. He gave the ball to Ayegbeni Yakubu, who laid it off to King and he beat Barnsley keeper Luke Steele at the second attempt.
Barnsley had the ball in the net immediately afterwards, but the effort was ruled out for offside.
However, Mellis did get them back into the game when his shot from the edge of the area found the bottom corner.
Gallacher and Wellens threatened before King scored his second goal of the game – a low, 18-yard drive after 58 minutes.
Garry O’Connor shot wide for Barnsley midway through the second half in a rare attack from the south Yorkshire side.
Steele produced two fine saves late on, palming away shots from Yakubu and substitute Matt Oakley.
But he was beaten for a fourth time in the 89th minute when Naughton let fly from 30 yards out.