How to determine z for logistic regressions

I understand that having squared terms in z generalizes the model well, but i am confused about how we decide z? is it just random like choose whatever you want?

Start with the simplest linear combination (the figure on the left).

If you don’t get good enough performance, then you start adding more quadratic terms.