Here is what I think is a factor, the police will initially stop someone maybe just for questioning (its happened to me and I am white).
I expect the way you respond affects how likely you will be searched. If you are cooperative, at ease, you are less likely to be searched, especially if you dont fit a profile of a crime recently reported in the area. On the other hand if you are uncomfortable, you are evasive in your answers, you act in a hostile manner (distrust of the police), then you are more likely to be searched. I have seen youtube videos where the person is recording apparently over aggressive police and I have been disgusted with the way the person is acting, deliberately been obstructive and they deserve to be treated the way they are.
Then we come to the rich poor argument again, poor neighbourhood's have more crime, more anti social behaviour, but also non British white people are much more likely to live and be in these neighbourhood's so they as a result have an increased chance of been stopped and searched as police will naturally be more prevalent in these areas.
Ultimately it comes down to this, the Police are under resourced, they have to be picky on what to target, this is going to lead to lopsided stats on all sorts of things, many crimes dont even get investigated, they will prioritise things like violent crime and crime of high commercial damage.
So when you consider that ethnic minorities are more likely to be anti police, more likely to live in poor areas, and based on police data are more likely to be carrying weapons, it isnt surprising they more likely to be searched.
I still remember once when I was in pcworld, with a friend, I had previously been to this pcworld dozens of times, with no issue, often wondering the store but not buying anything. This was my first visit with this friend who was of mixed race, I approached the manager (didnt know was manager at the time) to ask about a monitor and said I wanted to buy it, he went to the back to get it. As we was waiting we got approached by 2 security guards who told us to leave, my friend got into a bit of a tantrum and was panicking, I was a bit shocked as this never happened to me before but I told them I am waiting for my monitor so they decided to let us wait. The manager came out with the monitor and told them its ok and asked them to leave. He also called a worker over to take it to the till with us and help us take it to the car. On the way to the till the worker explained in the past couple of weeks there was a lot of paranoia as there had been a lot of stuff stolen in that spell and even a new worker got escorted of the premises. So I will never know if my friends skin colour had anything to do with it, but a logical explanation was provided by the worker.