First the terms you are looking for is biocompatibility and bioactivity. The study of them is called biomaterial science. Both fields are relatively new so complete answers do not exist, there has been a certain amount of trial and error in find suitable materials.
There are a dozen factors that go into these things, toxicity, whether they corrode in the body, whether they are soluble, chemical reactivity, whether they trigger an immune response, whether they can bond with bone or other tissues, mechanical resilience, steric and electrical properties, wetting, even how smooth it can be made can have an effect. The other important thing is many materials have very different biocompatibility depending how and where they are used, different parts of the body can have very different conditions, for instance material used in a bone screw might be useless in a dental implant (different PH and chemical exposure) or a heart valve (different mechanical and electrical requirements).
Titanium has remarkable biocompatibility with internal bone implant, its already low reactivity actually gets better as its surface oxidizes as it becomes slightly polarized and will incorporate many cellular surface molecules(passivation). Many of the factors that make titanium useful in this way are still being studied.
Surgical steel is a broad term that covers several types of steel used for multiple medicalpurposes, it includes steel implant and steel only used for instruments. Some forms of surgical steel work great for instruments but are rarely for internal implants, often because the same nickel content that makes them corrosion resistant is also bioreactive, triggering an immune response, but its superior mechanical properties means it still is sometimes used as implants, especially temporary implants were corrosion is less of an issue. (paper, sorry it is only available in German). Nickel free surgical steels used in cutting implements is stronger and harder (what you want in a medical blade) but without nickel it will quickly corrode in the body.
Part of the reason your doctor did not know was some aspects are still unknown in general and the study of these properties is rather specialized so a general practitioner may have never studied the parts that are known. Consider an pilot still know very little detailed metallurgy of their engine components, and still be an excellent pilot becasue they don't really need to know. Heck most of reason I know anything about it is I used to hang out with a guy who made titanium implant screws for a living and it just sounded kinda interesting so I read up on it.