How does the NHS Bowel Cancer Screening Programme know to invite me? Does the invitation system have all my medical details?

No, the invitations are generated by a system which only has the basic registration details held when you register with a GP. Any additional medical history is only accessed with your permission.