There were more checks many years ago.
My dad came to the UK as a Displaced Person after WW2 and was required to prove his fitness to stay here (and, eventually to be naturalised).
He was required to report to the local police station once a week and - for a specific period of time - to work where required by the UK. He genuinely did not have a problem with that.
He also knew that any bad behaviour on his part would mean deportation (with dire results for him). I suppose that nowadays he would be classed as an asylum seeker.
I'm unclear as to what kind of Home Office process the attacker could have been through. I've found one report which tells me that he arrived in Belfast in February 2023 and was granted leave to remain in December the same year.
My dad spent more than two years in British run Displaced Persons' Camps before he was allowed to set foot in this country and there was a stringent vetting and monitoring process. While in the DP camps, he worked under the British Army.
Of course some people won't see the difference between newer immigrants and those who came before, which is why it's in our* best interests to ensure that the proper checks are in place.
If it is decided that the attacker in this case is actually a previously upstanding person who had a mental health crisis and it is deemed that deportation would be inappropriate, then the only reasonable measure that I can think of would be to place him in a secure psychiatric facility sine die.
*Previous immigrants and their families
https://news.sky.com/story/belfast-knife-attack-heres-what-we-know-so-far-13552388