We study theoretically the erosion threshold of a granular bed forced by a viscous fluid. We first introduce a model of interacting particles driven on a rough substrate. It predicts a continuous transition at some threshold forcing theta(c), beyond which the particle current grows linearly J similar to theta - theta(c). The stationary state is reached after a transient time t(conv) which diverges near the transition as t(conv) similar to vertical bar theta - theta(c)|(-z) with z approximate to 2.5. Both features are consistent with experiments. The model also makes quantitative testable predictions for the drainage pattern: The distribution P(sigma) of local current is found to be extremely broad with P(sigma) similar to J/sigma, and spatial correlations for the current are negligible in the direction transverse to forcing, but long-range parallel to it. We explain some of these features using a scaling argument and a mean-field approximation that builds an analogy with q models. We discuss the relationship between our erosion model and models for the plastic depinning transition of vortex lattices in dirty superconductors, where our results may also apply.