Having impressed at Livorno, Favilli spent the 2015-16 campaign on loan at Juve, making one first-team appearance against Frosinone as a replacement for Alvaro Morata.
Favilli also scored 22 goals for Juve's youth side during his season-long loan before returning to Livorno.
The 21-year-old was loaned to Ascoli in 2016 and made his move permanent 12 months later, Favilli netting five times in 12 Serie B appearances in 2017-18.
He returns to Juve having signed a five-year contract with the Bianconeri that will see Ascoli receive a hefty initial payment, with €1.25m in add-ons should certain conditions be met before June 2021.
"This is the team that gave me a great opportunity a few years ago," said Favilli.
"Coming home is always nice.
"Last season was a bit unlucky, but I worked hard and now I'm fine and I'm ready for the new season."