They didn't performed that well in Euro 2021. They finished third in Group F (after France and Germany) and then lost to the top ranked Belgium in the pre-quarter finals. And in the qualifier tournament also, they started badly after their match with Serbia ended in a draw. But after that match they have performed exceptionally well and have won 4 matches in a row. It is now guaranteed that they will qualify for Qatar 2022 (which would be the farewell tournament for Cristiano Ronaldo. And if there are no upsets in the last match, they should finish ahead of Serbia in Group A.
I would not say that Portugal performed poorly, it performed at its own level. It would be too optimistic to assume that with the current roster, Portugal can seriously compete with teams of the level of France/Germany/Belgium. Everyone is looking at the European title and the presence of Ronaldo, but Portugal's real strength is now below all the top teams. The only moment when Portugal was on the list of the top national teams that I remember is the national team of the times of Figo (by the way, Ronaldo started playing for the national team already then) but those days are long gone.
By the way, I haven't heard anything about Ronaldo's retirement from the national team after the 2022 World Cup, was there any news?