Data Scientist role emerged and became popular before Data Engineer and ML engineer. These one were actually a response to the Data Scientist role being too wide. The first Data Scientist had to (and still sometimes, depending on the company) deal a lot with ETL pipelines, ML pipelines, but these required different skillset at scale.