Hey Julia, this is a very good question and I have been asked this many times.
"You own your content" you can republish your content anywhere you want and it is your choice to add a paywall to it on Substack if you choose to first publish it on Medium. Also, you can republish your Substack posts as Medium stories.
I hope this helps. :)