Certainly kicking ass at your job helps. Sometimes you kick ass and the company fails or merges or changes directions and there is nothing you can do. Even when there are tough changes companies don't like to lose good employees, just do your best. But realize that you can pick yourself up if you fall.