This is a very common practice called retargeting / behavioral targeting and has existed for about 2 decades at this point. Facebook is hardly the only company that does this.
Modern browsers are more strict towards third party cookies, but there are plenty of ways to work around this.