Hamlet has spent the entire play going between being in his philosophy (struggling to decide what to do -- i.e., to be or not to be) and being incredibly rash (killing Polonius). In his last moments, Hamlet rises to be the king he could be -- he is the best version of himself. His last speech is pragmatic and focused. Hamlet gives his support to Fortinbras with his dying breath -- he charges Horatio to tell what has happened (the state of ruin in Denmark at the hands of Claudius). He then says that the rest is silence -- almost bursting into his own explanation of what he wants Horatio to do upon his death. I think this could mean several things and I don't know that it's religious in tone (though Shakespeare came from a Catholic family in the midst of the rise of Protestantism). The rest is silence -- the rest doesn't matter. He isn't in his philosophy here -- he is busy, he is practical, and he is protecting Denmark. Hamlet is king, preparing the way for the next king. Also, the play is all about Hamlet reasoning what he wants to do and what he believes. With, the rest is silence, Hamlet is done. He has accomplished his goal -- it is finished.