here „ei” is after the noun and is showing a possesion that means that in this context is about her dog. When „ei” is a subject is translated as they. For example: Ei mănâncă (They eat). When we are talking about dativ case you will translate this word ”her/she”. (Ei) îi plac florile (She likes flowers). In this context this verb is used with dativ case and also the verb indicates that is the third person singular. if it was plural it should have been: (Lor) le plac florile (they like flowers).