A specialist simply works in one area in particular. It doesn't automatically mean that the person has extensive knowledge of that area. A new student could decide to specialize in a area of study, without yet having a lot of knowledge.
An expert has extensive knowledge or skills.