Very good question(s).
So I actually asked this year's ago wondering the same myself.
A team can/will do several things from what I gathered.
1)Priority udfa. Every team has a list of guys they think will go undrafted or make it as the draft unfolds. The difference between a 5th & udfa is almost non-existent so you can start there.
2)Trade out/Trade for vets
3)Most teams have boards where weighed out strictly by athletic testing. Again in the 5th round, why not? Athletes make up the sport, the draft is a bit of a gamble. Especially the further on you get. Take a shot.
4)This area, let's say 5th round. Is when you start to really think about ST players so there's always a few of those guys floating around that might not land on your top 50 or 75.
5)A team might only have 75 prospects that fit but chances are the people in the room have enough knowledge on others guys that might not have checked every box. Are good football players and around the 5th-6th round again why not take a shot.