The witches were introduced in Wyrd Sisters, a parody of Macbeth.
I make this comment just to amplify how Pratchett wrote. Wyrd Sisters is not a parody of Macbeth. It is an amplification of the technique of Rosenkrantz and Guildenstern are dead by Stoppard.
[plot spoiler alert]
In Stoppard's play, we see the action of Macbeth through the eyes of a pair of attendant lords. In Wyrd sisters a Macbeth-like plot unrolls, but instead of the witches just being incidentals as in the play, they get involved in the action and completely subvert it, arranging for someone who may or may not be the rightful king - with a huge plot twist on the way - to take over. The Birnham Wood scene acquires a huge mythic dimension. The Macbeth characters are urban in a rural environment and are seen as fundamentally out of place - I feel there is a reference there to the second homers who plague Wiltshire and Somerset, moving in and demanding that farms be closed because they don't like the noise and the smell. (You can probably guess where I live).
A parody is like the real thing but designed to expose the weaknesses of the writer and the improbability of his or her plots. A burlesque is a version of the original in which the jokes are broad and crude. What Pratchett does is to amplify Macbeth and at the same time bring in other related themes.
In Pratchett's world, Middle Earth is just a small part of the more backward region of Discworld, where some very unpleasant little wars took place and missionaries are going out to reclaim the Orcs for civilisation. A book ostensibly about football contains a powerful criticism of the moral void at the heart of Lord of the Rings and its default position that the aristocracy are the only people who matter. (Pratchett has an exchange between the Patrician and a ruler from Uberwald that makes it abundantly clear that this theme is intentional.)
Someone here has compared him to Jonathan Swift; the difference is that Swift is a pessimist and Pratchett, an optimist. Pratchett believes in improvement and perfectibility, and above all he believes in civilisation, whether it is small agricultural settlements like Lancre or large cities like Ankh-Morpork.