I think people who praise Pep or criticize him both have a point.
There's no question he's a brilliant manager and a winner. He was successful in every club he's worked at so far and his sides play a great style of football, which is not easy to implement, let alone harness to the point that you consistently dominate other sides. If you give him enough money and enough talent there's no better manager out there to deliver quality attacking football and trophies.
Having said that, the luck factor has definitely played a role in his managerial career. Due to his background and long time association with the club, Pep knew Barca's setup, hierarchy, playing system, academy etc very well before taking the job, and the array of talent he had available was incredible, not to mention they were willing to spend big, if needed, too. Doesn't take away from the job he's done there but that was near perfect start for him given the timing and circumstances. Then he moved to the easiest job in Bundesliga. Later, when he realized City needed to add more talent to build a side he had in mind they gave him a fortune to do just that.
My only argument vis-a-vis Guardiola is whether he's capable of implementing any other style. He was never in a situation where he had to make do with what he's got, so to speak, he either had the best talent available from the off (Barca, Bayern) or was getting top quality reenforcements soon after coming on the job (City). I remember Conte taking charge at Chelsea back in 2016, the side coming off the 10th place finish the season before, not getting any of the players in the summer he asked for and yet winning the title with what many would say, a limited side, which he inherited. Pep took over City the same summer and this was the squad Txiki was assembling for him for several years prior. He finished 3rd because he still hasn't assembled his dream team and needed the club to spend more and improve further. Hypothetically, would Pep have won the title with that Chelsea side in place of Conte? It's impossible to know for sure, but I doubt it. He has a certain playing philosophy in mind, he needs players with specific characteristics to implement it and I don't think he would even entertain the idea of sacrificing his principles to get the result, even if he thought he could pull it off, and I'm not sure he would be able to. Pep needs to have a near perfect situation for his magic to work and a combination of his talent and great timing of his career moves allowed him the kind of luxury most other managers simply don't have.