You don't accept every route neighbors send. Filtering protects your network and implements policy.
Filter types:
Prefix filters. Accept or reject based on IP prefix. Block private ranges or too-specific routes.
AS_PATH filters. Accept or reject based on AS path. Block routes through certain ASes.
Attribute filters. Modify attributes on matching routes. Set LOCAL_PREF or add communities.
Inbound vs outbound: Filter what you accept and what you send. Don't leak routes you shouldn't propagate.