There are two concepts / principles applied in order to come up with the PST that is the product of a square of a binomial.
Firstly, applying the FOIL (first, outer, inner, and last) method, you multiply the first terms, outer terms, inner terms, and last terms of the binomial by itself.
Secondly, using a shortcut method of squaring the first term, multiplying the first and second terms then multiplying it by constant 2, and then squaring the last term.
Using either method or principle will result in the same answer, only the second principle being a faster method of calculating.
Happy solving! :)