What “work” is burned up?

What exactly is the work that’s burned up in 1 Corinthians 3? Is this chapter about earning rewards in Heaven? And what did Paul mean by God destroying those who destroy His temple? What’s up with Ananias and Sapphira in Acts 5? Did God kill them? If so, for what reason?