At the end of episode 5, 

>! Why does Rem kill Subaru, despite nothing wrong with relationship between them ?

These events unfold starting at minute 22. 

At the end of Episode 5, at night, Subaru is sick. He goes out to find help. He is attacked. At 23:35 to 23:40, we hear the sound of an iron weapon (which is likely to be Rem's morningstar). And Subaru is killed with brute force.

[![Subaru, dying][1]][1]

However, it is unclear why Rem does that, given that Rem's relationship with Subaru is looking good. They both go to the village and talk. Rem also looks happy then (at 17:29).  

[![Rem, happy][2]][2]
 
I did watch Episode 6, where Subaru is very distant from Rem, and he acts suspiciously, along with having the witch's scent that gets him killed. But does Rem kill Subaru in Episode 5 for the same reason?

---

**Edited**: From @ObviouslyJake's answer, I would like to add some more detail comparing the time frame in episodes 5 and 6:
- Similar: Subaru's **witch smell** (which is the main reason, according to @ObviouslyJake)
- Different: the relationship with Rem 

Episode 5: They talk and go to the town together. Rem is happy. (As I said above, with an accompanying picture). In this episode, I can feel that Rem and Subaru become friends.

Episode 6: Rem tries to be distant from Subaru. Also, Subaru falls in her garden twice, which she has to fix. In this episode, Rem and Subaru are strangers.  

Does the difference in the relationship between Subaru and Rem contribute to Subaru's death at the end of episode 5, compared to episode 6? Or is the witch's smell the only reason?

Because there are two episodes, with some different choices and paths, I think there must be something **different** here. I feel there has to be, but I can't find it. 

---

**Edit (Aug 31, 2016):** Thanks to @Davies comment and @ObviouslyJake, here is what I have in my head so far: in episode 6, things are worse than in episode 5. Here, we're talking about why Rem kills Subaru in episode 5, despite them having a good relationship.

My theory is that Rem has a dual personality: Rem the maid, and Rem the oni who hates the Witch. 

In episode 5, Subaru has a good relationship with Rem the maid. As a result of having a good relationship with Rem the maid: <br>
- Rem smiles at 17:29 (picture above) <br>
- Rem gets Emilia to teach Subaru in the evening. (Episode 5, 17:57) <br>

[![Emilia-sama][3]][3]

However, Rem the oni still hates the Witch, which leads to Rem killing Subaru because of his Witch smell.
 
Therefore, here is a summary: Rem will try to kill Subaru because of the Witch smell unless the following condition is satisfied: 

 - Rem is dead (nothing to say, I suppose...)

or 

 - Rem the Oni is freed from the tragedy of her childhood. 

(Spoilers for episode 18 follow) 

>! The second condition is satisfied when Subaru saves Rem from the demon beast in the forest in episode 11. The proof is in episode 18, from 20:00 to 21:00, where Rem confirms that.  
>! [![ep18_1][4]][4] [![ep18_2][5]][5]

That is what I think, please tell me if I wrong. 


  [1]: https://i.sstatic.net/DraOVm.jpg
  [2]: https://i.sstatic.net/hvPt3m.jpg
  [3]: https://i.sstatic.net/2qHdcm.jpg
  [4]: https://i.sstatic.net/6Cs1ym.jpg
  [5]: https://i.sstatic.net/wpA4Um.jpg