The Shulchan Aruch and the Rema had their own methodology.
As is written in the Introduction to Beit Yossef (available here), when writing the Shulchan Aruch, Rabbi Yossef Karo relied in the majority view by 3 rishonim, which are, the Rif, the Rambam and the Rosh. When all three omitted some law of the Talmud, the Beit Yossef would follow the major rishonim which did in fact write about the subject.
The Rema methodology (brought up in his book Torat Chatat, available here) was to add commentaries when the halacha from the Shulchan Aruch conflicted to practices of ashkenazi jews of his times.
Some times, the rishonim would not bring some practice from the Talmud because they sustained it was not relevant to their times for some specific reason (depends on what the case is), and if, for example, (1) other major rishonrishonim would write this explicitly that indeed the practice was not relevant for whatever reason (or simply no other rishonim would write about it) and (2) the norm practice was not to follow this practice, it would fit in the criteria not be brought up by the Shulchan Aruch (point 1) or the Rema (point 2).
An example this would be the prohibition of "linat laila" (overnight stay - consisting of eating a peeled garlic/onion/egg which was stayed overnight), brought up in the Talmud in Massechet Niddah 17a, about which the Rabenu Tam sustained is not relevant in our days, and it was omitted by the Rif, the Rambam and the Rosh (because they hold like Rabenu Tam, see Shut Iad Meir Siman 19, available here), therefore is omitted by the Shulchan Aruch and the Rema as well (see Shut Iad Meir mentioned above about the customerhabit of the world being not be cautious about this). In this specific case, some other later authorities, like the Aruch Hashulchan in Yore Deah 116:22, the Shulchan Aruch HaRav, Rabbi Ovadia Yossef and others, hold like the disagreeing part of the discussion and hold that this prohibition is relevant still in our days. For more about the discussion on this prohibition see here