It mostly boils down to how the University organises its degree program, you are correct on the definitions of the degrees. The undergraduate programs are for undergraduates, and will take typically 4 years to complete (equivalent of 3 years of normal undergraduate program, and 1 year for the masters component).
There is usually a mechanism for just doing a postgraduate masters similar to the masters part of the undergraduate program, where the title would be different as it was officially a different degree (postgraduate instead of undergraduate).
Having undergraduate masters programs help in the UK with applying for student finance, as "student loans" are readily accessible for undergraduates, but not for postgraduates. So it makes sense to do it all in one and get the undergraduate loans for the full masters program.
Some people suggest that a "proper" postgraduate masters is better than a program with an integrated masters for undergraduates, but in reality I haven't found anywhere that would discriminate between the two.