Not sure why this question was down voted, some explanation would have helped...
In general: A p2sh tx sends data to a hash. The hash is a one way function, so we cannot know, what content is behind the hash... also there is no double mining or similar. There is a funding tx, and a spending tx. Like with any other tx, you mine a first tx from someone else to my account, and if I spend the tx, another tx is created and mined. Same applies to p2sh transactions.
The funding tx is created, defining a condition for spending the funds (e.g. multisig, with a “type3” address), and post this tx to the network. Everyone can see the tx, but nobody knows, what’s inside (privacy gain). If then one day these funds get spent, the content of the hash is made visible, and only then one can see, what the original funding tx was about.
Advantage beside privacy: the funding of the tx is fairly cheap on fees, cause you have a short tx with several bytes. The spending tx however, reveals the hash contents, and if multisig, can be very long (increasing tx size and thus fee costs).
I found the best explanation for this in Andreas book “Mastering Bitcoin”, which is also available online.