Every team against Barcelona tries to show their best performance, and they also try to defend very well because they know that Barcelona is an attacking team and will create a lot of chances. Rayo Vallecano were lucky to play well in defense and, moreover, they were lucky to score a goal. Yes, you are right that sometimes such matches happen, and Barcelona expected to get an easy win here, but afterwards they couldn’t pull themselves together and score again. It’s disappointing to drop points at the very start of the league, but that happens too.
Yes, every team facing Barcelona seems to know what to do because they certainly want to win, even against a strong team. Each team typically employs a defensive strategy. Rayo also employed their defensive strategy to counter Barcelona's attacks. Rayo proved to be able to overwhelm Barcelona, ultimately leading to a 1-1 draw.
In my opinion, if Barcelona wants to win, Flick must devise a good strategy to spread out the opposing defense or push forward so that Barcelona's attacking players can penetrate the opposing defense easily. However, Barcelona's lack of maximum points will undoubtedly be disappointing, but it can't be helped, as Barcelona was simply less than vigilant at the time. Hansi Flick must learn from this experience to avoid repeating the same mistakes.