Could someone please explain the following behavior of bash and if my understanding is correct:

1. `echo abcd > abc def`

> 
> the echo abcd prints it out to std out stream, but since due to the presence of ">" it is redirected to the file abc
>  How is def stored as a string in the file abc and not as another file containing the string abcd?
> 
> 
>
2. `echo abcd > abc > def`

> 
> This results in the string abcd to be stored in the file def and the file abc remains empty. How ?
> 
> 
>

Thanks.