The 20-year-old forward was deemed surplus to requirements by Marcelo Bielsa at Elland Road having made just one senior appearance for the club.
Wilks enjoyed a prolific loan spell with Doncaster Rovers in League One last term, bagging 16 goals and 11 assists in all competitions at the Keepmoat stadium.
Barnsley have beaten off strong interest from Championship rivals Hull City with former Rovers boss Grant McCann - who took over at the KCOM last month - keen on his services.
Wilks, though, has put pen to paper on a four-year deal at Oakwell and will now begin his preparations for a first stint in the second tier.
He said: "Barnsley made me feel wanted, they were ringing me all the time every day, so it’s the best place for me.
"It’s a good club and I know a few of the boys here. It’s a good set of lads and they did well last season. There’s a lot of energy in the group and the style of play suits me, I wanted to take the step up.”
The forward had been due to go on trial at Leeds Crown Court on July 1, but saw his case re-listed until May 11 next year.
He is accused of violent disorder and assault occasioning actual bodily harm, with both offences alleged to have taken place in August 2017 in relation to an incident at Leeds West Indian Carnival.
Wilks pleaded not guilty to the charges at a hearing at the court last November.