As far as I know Tolkien wrote it as one story (obviously meant to be read together) but the publishers due to many reasons (including paper shortage after the war) decided to publish it in three parts.
Hope that helps