Sure and surely are both used as simple intensives. Sure is informal and typically used when the speaker or writer expects to be agreed with. She sure knew how to make me laugh. That sure was fun. Surely can occur in formal contexts and is used whether or not agreement is expected.
Being sure has to do with being certain, convinced, trustworthy, or dependable. You can trust a sure thing.