Pretty sure it works out your heart rate zones from your FTP tests, alongside your power zones.
I think it takes your average heart rate during the test (along with your average power) and calls that your LTHR (lactate threshold (or functional threshold) heart rate) then applies percentages for each zone. If you've never done an FTP test, it can also take it from any ride that is 30 minutes or longer (it should look at the hardest 20 minutes), though it only seems to do this if your average power is higher than your current FTP power.
At my last FTP test my average Heart Rate was 161, so my LTHR is 161.
Z4 is around your LTHR (c. 98% - 110%)
Z5 is above your LTHR (c. 110% - 111%)
Z6 (c. 111%) is not really your max, as that would be more accurate if you just rode harder and harder until you reached a plateau or passed out/threw up/died. It's just sufficiently above your LTHR to be very likely that you are working anaerobically and will be able to sustain that rate only for a limited time.
Heart rate is much more variable than power, and depends on so many other factors, hence it is only really a rough guide to effort.
My maximum heart rate on the road was 185 bpm around 2 years ago, climbing Salcombe Hill. I'be got no where near that since, probably because I've got fitter (from a cardio vascular point of view) and my legs struggle to sustain the power where my heart rate would hit that again.
I also think some of that heart rate was due to fear, as I was well outside my comfort zone and expecting to fall before I got to the top or managed to unclip my pedals!
Geoff