A Factory is where you can find Machines that craft Boosters. Once you have collected enough Sugar Bags, a Machine unlocks in the Factory.
The Machine then provides you with a Booster that you can use for an hour to complete levels.
The first Machine that you can activate in the Factory is the Scrumdiddlyumptious Machine and it provides you with the Scrumdiddlyumptious Chocolate Booster.