Question: how did damon and elena get together?
Answer: So she had some feelings towards Damon. After they got back Stefan Elena died and became vampire with Damon's blood in her system. As such she was siered to him and fall in love with him. But the moment when Damon gave her the necklace that Stefan had given her she falls for him being so selfless.