Illustrator can be a bit tricky sometimes, especially when there are so many ways to accomplish something. According to Adobe, “compound paths act as grouped objects” and they also say, “When you define objects as a compound path, all objects in the compound path take on the paint and style attributes of the backmost object [...]