As pay-as-you-go only charges you for what you use, each individual text or minute on the phone incurs its own charge, at a set tariff charged by your network.
On pay-as-you-go, you add money to your SIM, and some of that credit is then spent every time you make a call, send a text, or use mobile internet. When it runs out (or when you think it might run out soon), you can top it up. Bear in mind, though, your pay-as-you-go SIM could be cut off if it isn’t used for a certain amount of time.