We cannot know anything for certain
However we can make some astute speculation.
Margaery appears to be a more subtle manipulator than Cersei and far more able to dispense with her pride (which is considerable) when it would interfere with that.
Given that, and drawing some inspiration from the novels, we see that she seems to consider that when threatened by the faith at Cersei's doing, grasping the nettle (rose?) is the correct play. She surrenders and embraces the faith, humbling herself in ways that Cersei refuses to do for a long time and does so self-destructively when she realises the necessity.
In doing so, and in bringing Tommen into the faith, she takes him further from Cersei. She's found a way to turn the faith somewhat to her service.
The High Sparrow appears to be aware of this but accepting of it as he plays Cersei and Margaery against each other to further his (and the sparrow's) influence.
We can't know what her next move was going to be but it seems that she felt that she could largely evade the consequences of her actions by humbling herself and then turn the faith against Cersei, which is more or less what happens in the books. Loras is wounded in battle, potentially dying, and not arrested by the High Sparrows in the novels so we have no guidance on his fate.
In general, Margaery is a more subtle and less violent player than Cersei but Cersei is quicker to destroy her opponents rather than disarm them.