There are loads of different types.
It's like a text template / text recognition/ data base all rolled into one.
So it might start off with some key words and template sentences and fill in the nouns, adjectives ect... from whats in its database/ libraries / word lists.
Or acts like a search engine kind of , starts off with key words and searches the internet or its libraries, data base , lists whatever for sentences with those key words and mashes them together.
Or another way, there is more than one way to skin a cat.