Clickbait vs. Quality: How Engagement-Based Optimization Shapes the Content Landscape in Online Platforms