We are going to a conference and we are taking a new ipad with us to give away but we don't want to box to be opened. Will they just run it through the scanner or do they have to open it?
As long as its x-rayable it should be fine. Not guaranteed, but in the same way your bag remains closed, they can still scan it.
However, since these days they quite often request that you remove laptops etc for separate scanning, they may require that of you. But that's just to separate it from the rest of your luggage - as long as the box it's in is scannable, you should be completely fine. There's no reason for them to want to or need to open it unless it has something dodgy inside, and I guarantee they've scanned enough iPads to just be 'ugh, another iPad'.
One additional step is if this conference is in another country, customs at the destination country may require you to declare it, especially as it's not for you. But again, they will have no reason to open and search it, it's merely for tax purposes in this case, and just one shouldn't be a cause for concern.
(usual disclaimer, IANAL = I am not a lawyer)
If they can scan it clearly, it should be OK. My experience in the US for the past 6 months is that I am not being asked to take an iPad out of a backpack or shoulder bag when I go through the checkpoint.
If you just pass the box through by itself, you will increase your chances that it will not be opened.
However, in the US and any other country where I have flown, the security agents can ALWAYS ask to see inside a bag that is being screened.
If you check it, the TSA can always open anything they deem necessary, unfortunately. I don't recommend checking an unopened iPad. It might not arrive at all.