Goals from Philippe Coutinho, Paulinho and Lionel Messi in the first half put Ernesto Valverde's Spanish champions on course for victory before a late double by Ousmane Dembele added to the visitors' woes.
Barca were the first to apply pressure in the final third, with Messi gaining possession on the edge of the box in the seventh minute and letting fly with a curler, bending the ball wide of the left upright.
The Catalans took the lead just after the 10-minute mark when Dembele's shot proved too hot for Villarreal goalkeeper Sergio Asenjo to handle, allowing the onrushing Coutinho to smash the ball in on the rebound.
Villarreal almost registered an immediate response as Pablo Fornals went on a blistering run and unleashed a curling strike towards the top corner, forcing Jasper Cillessen into acrobatics to save at full stretch.
Valverde's side doubled their advantage moments later through Paulinho, who capped off a blistering Barca counter by tapping Lucas Digne's pass across the face of goal into the back of the net.
Dembele put the visitors under pressure again in the 22nd minute, running at their defence and getting an angled shot away, forcing Asenjo to get down quickly to palm the ball away.
The La Liga champions made it 3-0 on the stroke of half time when Messi timed his run into the box to perfection to meet veteran midfielder Andres Iniesta's through-pass and guide the ball beyond the Villarreal stopper with the slightest of touches, putting his side almost out of sight at the interval.
The visitors pulled one back less than 10 minutes after the restart under fortuitous circumstances as substitute Nicola Sansone deflected Fornals's shot beyond Cillessen and into the net, completely unintentionally and amid strong claims of handball from the hosts.
Coutinho thought he had claimed his second of the night in the 72nd minute when he blasted Dembele's cutback over the line from close range, but the goal was rightly ruled out for an offside against the Brazil international.
Sansone almost added another goal to his tally moments later when he struck a thunderbolt towards the Barca goal from 20 yards, putting his effort just inches over the crossbar.
The home side put the result beyond any doubt with a late double from Dembele, who scored his first of the night three minutes from time when substitute Ivan Rakitic tore the away defence apart and squared the ball for his teammate to tap in from close range.
Dembele added gloss to the scoreline in stoppage time after exchanging passes with Yerry Mina and chipping the ball over Asenjo to net Barca's fifth and his second of the evening.
The Spanish champions are now two games away from making history by going an entire season unbeaten, with Levante away and Real Sociedad at home standing between them and that feat.
Villarreal, meanwhile, were guaranteed to be in next season's Europa League ahead of kickoff but missed out on the chance to move above Real Betis into fifth in the La Liga table.
BARCELONA (4-3-3): Cillessen; Digne, Semedo, Vermaelen, Pique (Mina 80'); Busquets (Rakitic 65'), Paulinho, Iniesta (Suarez 70'); Coutinho, Dembele, Messi
VILLARREAL (4-5-1): Asenjo; Costa, Ruiz, Gonzalez, Gaspar; Trigueros (Fuego 57'), Cheryshev (Sansone 45'), Castillejo, Rodri, Fornals; Bacca (Unal 70')