In what types of cases is precedent, as opposed to legislation, used to establish law? Is there no set custom?
In controversies where legislation does not provide sufficient guidance on what conditions are indispensable and what remedies or outcome shall follow. Even in those scenarios, case law is required to abide by the Constitution and not be inconsistent with the existing legislation (unless that legislation turns out to be unconstitutional).
However, Congress never had to pass a law or constitutional amendment defending abortion rights.
That is because the holdings in Roe v Wade purportedly do not contravene the Constitution.
By contrast, if Congress seeks to outlaw abortion or make it strictly dependent on state law, Congress would have to start by amending the Constitution in a way that renders criteria of quickening and fetal viability irrelevant to the recognition of a fetus as a person.