I recently had my post edited by an MSE member. The editor removed the 'Thanks' I had put at the end of my post. This happened sometime earlier too.
Is it discouraged to write 'Thanks' in our posts?
If yes, then what is the reason?
It is customary in this site not to add Thanks at the end of the post, and by now this practice has become a faux pas. Whatever the original reasons and the perceived advantages of this choice, now it forms part of tradition.
Posters who do use Thanks signal that they are new to this site, and so more prone to posting low quality posts. That explains Normal Human's observation quoted in the other answer.
I don't edit posts only to remove thanks. But if I do edit for some other reason, I'll remove thanks along the way.
Why? Because what's written once is read many times — mostly, by people who are not going to post an answer to your question. For them, the thank-you line is just one more line on the screen separating them from the answers: nothing but visual noise.
Tangential remark: "thanks in advance", "any [something] is [somehow] appreciated", and especially "please help" are pretty good indicators of what I find to be low-quality posts. It seems that the users who make an effort to formulate a good question don't find it necessary to sprinkle their posts with pleas or thanks. I suppose they know they are contributing something, rather than begging for something, and so they post with more confidence.